import path from 'path';
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'

const routes = [
  // { path: '/', redirect: { path: '/isFirstLogin' },  },
  { path: '/', alias: '/isFirstLogin', component: () => import('@/views/InformationCollection/isFirstLogin.vue') },
  { path: '/Home', name: '首页', component: () => import('@/views/Home/index.vue')  },
  { path: '/InformationCollection', name: '添加信息', component: () => import('@/views/InformationCollection/index.vue') },
  { path: '/addChildren', name: '新增子女', component: () => import('@/views/InformationCollection/addChildren.vue') },
  { path: '/childrenInfo', name: '子女信息', component: () => import('@/views/InformationCollection/childrenInfo.vue') },
  { path: '/editChildren', name: '编辑子女信息', component: () => import('@/views/InformationCollection/editChildren.vue') },
  { path: '/Message', name: '家教资讯', component: () => import('@/views/Message/index.vue') },
  { path: '/MessageDetail', name: '资讯详情', component: () => import('@/views/Message/detail.vue') },
  { path: '/PointsMall', name: '积分商城', component: () => import('@/views/PointsMall/index.vue') },
  { path: '/GiftDetail', name: '礼品详情', component: () => import('@/views/PointsMall/detail.vue') },
  { path: '/ConfirmOrder', name: '订单确认', component: () => import('@/views/PointsMall/order.vue') },
  { path: '/exchangeSuccess', name: '订单反馈', component: () => import('@/views/PointsMall/success.vue') },
  { path: '/OrderInfo', name: '我的订单', component: () => import('@/views/Order/index.vue') },
  { path: '/OrderDetail', name: '订单详情', component: () => import('@/views/Order/detail.vue') },
  { path: '/PersonalCenter', name: '个人中心', component: () => import('@/views/PersonalCenter/index.vue') },
  { path: '/personalInfo', name: '个人信息', component: () => import('@/views/PersonalCenter/personalInfo.vue') },
  { path: "/VideoPlay/:videoId", name: '微课播放', component: () => import('@/views/VideoPlay/index.vue')  },
  { path: "/AnswerPage", name: '答题', component: () => import('@/views/AnswerPage/index.vue') },
  { path: "/AnswerResultSuccess", name: '答题通过', component: () => import('@/views/AnswerResult/success.vue') },
  { path: "/AnswerResultError", name: '答题失败', component: () => import('@/views/AnswerResult/error.vue') },
  { path: "/SearchPage", name: '搜索页', component: () => import('@/views/SearchPage/index.vue')  },
  { path: '/:pathMatch(.*)*', name: '404', component: () => import('@/views/404/index.vue') },
];

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
})

//  配置全局路由


export default router;
